import { createApp } from 'vue'
import App from './App.vue'
import './assets/global.less'
import components from './components/global'
import Router from './router/index'
// Pinia
import { createPinia } from 'pinia'
// Pinia持久化
import piniaPluginPersist from 'pinia-plugin-persist'

// element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'


const app = createApp(App)
app.config.productionTip = false

// components
for (const i in components) {
    app.component(i, components[i])
}
// icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
const pinia = createPinia()
pinia.use(piniaPluginPersist)

app.use(Router)
app.use(ElementPlus)
app.use(pinia)
app.mount('#app')
